package xxx;

public class Test {
    public static void main(String[] args){
        Student stu1 = new Student("高健");
        Student stu2 = new Student("小明");
        Lab lab1 = new Lab("计算机网络实验室");
        Lab lab2 = new Lab("组成原理实验室");
        Lab lab3 = new Lab("物理实验室");
        Lab[] allList= new Lab[]{lab1,lab2,lab3};
        Lab[] lablist1= new Lab[]{lab1,lab2};//高健打扫的实验室
        Lab[] lablist2= new Lab[]{lab3};//小明打扫的实验室
        stu1.setlablist(lablist1);//高健打扫的实验室
        stu2.setlablist(lablist2);//小明打扫的实验室
        for (int week = 0; week < 18; week++) {//遍历二维数组中所有行
            int labname = 0;
            for (Lab j :allList ) {
                j.setRank(week, labname);//将week,labname的值作为数组的行和列的数
                labname++;//遍历二维数组中所有列
            }
            for (Lab i : stu1.lablist) {
                stu1.setSalary(stu1.RankSalary(i.rank));//利用Student中的setSalary方法，将stu1税前工资数赋值给salary变量
            }
            for (Lab i : stu2.lablist) {
                stu2.setSalary(stu2.RankSalary(i.rank));//利用Student中的setSalary方法，将stu2税前工资数赋值给salary变量
            }

        }
        stu1.salary = stu1.Taxes(stu1.salary);//利用Taxes方法，计算stu1税后工资数
        stu2.salary = stu2.Taxes(stu2.salary);//利用Taxes方法，计算stu2税后工资数
        System.out.println("学生" + stu1.name + "的税后年收入为:" + stu1.salary);
        System.out.println("学生" + stu2.name + "的税后年收入为:" + stu2.salary);
    }
}
